{% extends "base.html" %}
{% block content %}
            <li class="active"><a href="/view_chart/">查看购物车<font color="#FF0000">{{ count }}</font></a></li>
          </ul>
          <ul class="nav navbar-nav navbar-right">
           <li><a href="/user_info/">{{user}}</a></li>
           <li><a href="/logout/">退出</a></li>
         </ul>
        </div><!--/.nav-collapse -->
      </div>
    </nav>

    <div class="container theme-showcase" role="main">

      <!--商品表单-->
      <div class="page-header">
        <div id="navbar" class="navbar-collapse collapse">
          <form class="navbar-form" method="post" action="/search_name/">
            <div class="form-group">
			{% csrf_token %}
              <input name="good" type="text" placeholder="名称" class="form-control">
            </div>
            <button type="submit" class="btn btn-success">搜索</button>
          </form>
        </div><!--/.navbar-collapse -->
      </div>

      <div class="row">
        <div class="col-md-6">
          <table class="table table-striped">
            <thead>
              <tr>
                <th>编号</th>
                <th>名称</th>
                <th>价钱</th>
				<th>查看详情</th>
                <th>放入购物车</th>
              </tr>
            </thead>
            <tbody>
              {% for goods in goodss %}
                <tr>
                  <td id="id">{{ goods.id }}</td>
                  <td id="name">{{ goods.name }}</td>
                  <td id="price">￥{{ goods.price }}</td>
                  <td><a href="/view_goods/{{goods.id}}/">查看</a></td>
                  <td><a href="/add_chart/{{goods.id}}/1/">放入</a></td>
                </tr>
             {% endfor %}
            </tbody>
          </table>
        </div>

      </div>
 <!-- 列表分页器 -->
    <div class="pagination">
      <span class="step-links">
        {% if goodss.has_previous %}
          <a href="?page={{ goodss.previous_page_number }}">上一页</a>
        {% endif %}
          <span class="current">
            Page {{ goodss.number }} of {{ goodss.paginator.num_pages }}.
          </span>
        {% if goodss.has_next %}
          <a href="?page={{ goodss.next_page_number }}">下一页</a>
        {% endif %}
      </span>
    </div>
{% endblock %}
